Jx.declare('Jx.lib.Array', {

	$singleton: true,

	unique: function(){

		var arrays = Array.prototype.slice.call(arguments, 0),

			defined = [],

			J = Jx;

		//-- remove duplicates
		for(var value, array = arrays.shift(), currLength = 0; array ; array = arrays.shift()){

			if (!J.isArray(array)){

				continue;

			}

			for(var l = array.length; l--;){

				if (defined.lastIndexOf(value = array[l]) == -1){

					defined[ currLength + l ] = value;

				} else {

					defined.splice(currLength + l, 1)

				}

			}

			currLength = defined.length;

		}

		return defined;

	}

});
